﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Security.Cryptography;

namespace Weixin.Web
{
    public partial class jssdk : System.Web.UI.Page
    {
        protected string noncestr = string.Empty;
        protected string jsapi_ticket = string.Empty;
        protected string timestamp = string.Empty;
        protected string signature = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            //Response.Write(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile("123", "sha1").ToLower());
            //Response.Write("<br>");
            //Response.Write("0f9de62fce790f9a083d5c99e95740ceb90c27ed");
            //Response.Write("<br>");
            //Response.Write(Guid.NewGuid().ToString());
            //Response.Write("<br>");
            //Response.Write(DateTime.Now.Ticks);

            WX wx = new WX();
            string url = Request.Url.ToString().IndexOf("#") > -1 ? Request.Url.ToString().Substring(0, Request.Url.ToString().IndexOf("#")) : Request.Url.ToString();
            string[] arr = wx.GetJSSDK(url);
            noncestr = arr[0];
            jsapi_ticket = arr[1];
            timestamp = arr[2];
            signature = arr[3];
            //Response.Write(Request.Url);
        }
    }
}